﻿using QYmall.Core.Common.Emum;
using QYmall.Core.Common.Helper;
using QYmall.Core.Model.Models;
using QYmall.Core.Model.ViewModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using System.Threading.Tasks;

namespace QYmall.Core.IServices
{
    /// <summary>
    /// 商品退换货接口
    /// </summary>
    public interface IOrderRefundService : IBaseService
    {
        /// <summary>
        /// 查询一条记录
        /// </summary>
        Task<OrderRefund?> QueryAsync(Expression<Func<OrderRefund, bool>> funcWhere, WriteRoRead writeAndRead = WriteRoRead.Read);

        /// <summary>
        /// 查询指定数量列表
        /// </summary>
        Task<IEnumerable<OrderRefund>> QueryListAsync(int top, Expression<Func<OrderRefund, bool>> funcWhere,
            string orderBy, WriteRoRead writeAndRead = WriteRoRead.Read);

        /// <summary>
        /// 查询分页列表
        /// </summary>
        Task<PaginationList<OrderRefund>> QueryPageAsync(int pageSize, int pageIndex, Expression<Func<OrderRefund, bool>> funcWhere,
            string orderBy, WriteRoRead writeAndRead = WriteRoRead.Read);

        /// <summary>
        /// 获取记录总数量
        /// </summary>
        Task<int> QueryCountAsync(Expression<Func<OrderRefund, bool>> funcWhere, WriteRoRead writeAndRead = WriteRoRead.Read);

        /// <summary>
        /// 1.申请退换货
        /// </summary>
        Task<bool> ApplyAsync(OrderRefundApplyDto modelDto, WriteRoRead writeAndRead = WriteRoRead.Write);

        /// <summary>
        /// 2.卖家处理:同意,拒绝,退款
        /// </summary>
        Task<bool> HandleAsync(Expression<Func<OrderRefund, bool>> funcWhere, OrderRefundHandleDto modelDto, WriteRoRead writeAndRead = WriteRoRead.Write);

        /// <summary>
        /// 3.买家发货
        /// </summary>
        Task<bool> BuyDeliveryAsync(Expression<Func<OrderRefund, bool>> funcWhere, OrderRefundBuyDto modelDto, WriteRoRead writeAndRead = WriteRoRead.Write);

        /// <summary>
        /// 4.卖家发货
        /// </summary>
        Task<bool> SellerDeliveryAsync(Expression<Func<OrderRefund, bool>> funcWhere, OrderRefundSellerDto modelDto, WriteRoRead writeAndRead = WriteRoRead.Write);

        /// <summary>
        /// 根据条件删除记录
        /// </summary>
        Task<bool> DeleteAsync(Expression<Func<OrderRefund, bool>> funcWhere, WriteRoRead writeAndRead = WriteRoRead.Write);
    }
}
